package com.example.financecollegeorderdish.ui.dialog

import android.content.Context
import com.example.financecollegeorderdish.R
import com.example.financecollegeorderdish.databinding.DialogRatingBinding
import com.example.financecollegeorderdish.ui.MainActivity
import com.lxj.xpopup.core.CenterPopupView

/**
 * 旋转靶机
 */
class RatingDialog(context: Context, var view: MainActivity) : CenterPopupView(context) {
    val mBinding: DialogRatingBinding by lazy { DialogRatingBinding.bind(contentView) }

    /**
     * 具体实现的类的布局
     *
     * @return
     */
    override fun getImplLayoutId(): Int = R.layout.dialog_rating

    /**
     * do init.
     */
    override fun onCreate() {
        super.onCreate()

        mBinding.btSure.setOnClickListener {
            view.showSuccess("评价成功")
            dismiss()
        }
        mBinding.btCancel.setOnClickListener {
            dismiss()
        }
    }
}